package egovframework.npqs.pqi.mobile.util;

import java.util.ArrayList;
import java.util.HashMap;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import android.util.Log;
import egovframework.npqs.pqi.mobile.common.Const;


public class ParameterUtil {

	public static ArrayList<NameValuePair> getLoginPostParams(String userId) {	// 로그인 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ001));
		paramsArray.add(new BasicNameValuePair(Const.USERID, userId));
		
		return paramsArray;
	}
	
		
	/*public static String getLoginParams(String userId) {	// 로그인 파라메터
		String replaceString = userId.replace(" ", "%20");
		String params = "";
		
		params = isNull(params) ? (params = "?") : (params += "&");
		params += Const.PARAM_TARGET + "=" + Const.REQ001;
		
		if(!isNull(userId)) {
			params = isNull(params) ? (params = "?") : (params += "&");
			params += Const.USERID + "=" + replaceString;
		}
		
		return params;
	}*/
	
	public static ArrayList<NameValuePair> getFirstPostDisinfection(String offCd) {	// 소독대기 최초 파라메터
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ014));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	public static ArrayList<NameValuePair> getPostDisinfection(HashMap<String, String> searchMap) {	// 소독대기  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ014));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("cprNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHCPRNM, searchMap.get("cprNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getFirstPostQuarantine(String offCd) {	// 검역신청  최초 파라메터
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ002));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	public static ArrayList<NameValuePair> getPostQuarantine(HashMap<String, String> searchMap) {	// 검역신청  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ003));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("insPlace").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSPLACE, searchMap.get("insPlace").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		if(!isNull(searchMap.get("searchBlNo").toString())) {
			Log.i("searchBlNo2", searchMap.get("searchBlNo").toString());
			paramsArray.add(new BasicNameValuePair(Const.SEARCHBLNO, searchMap.get("searchBlNo").toString()));
		}
		
		if(!isNull(searchMap.get("searchHwaNo").toString())) {
			Log.i("searchHwaNo2", searchMap.get("searchHwaNo").toString());
			paramsArray.add(new BasicNameValuePair(Const.SEARCHHWANO, searchMap.get("searchHwaNo").toString()));
		}
		
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getQuarantineDetailParams(String offCd, String recNo) {	// 검역신청 상세 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ004));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, recNo));
		}		
		
		return paramsArray;
	}	
	
	public static ArrayList<NameValuePair> getDisinfectionDetailParams(String planSn, String recNo) {	// 소독결과 상세 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ017));
		
		if(!isNull(planSn)) {
			paramsArray.add(new BasicNameValuePair(Const.PLANSN, planSn));
		}	
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.RECNO, recNo));
		}
		
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getSaveDisinfectionDetailParams(String planSn, String recNo) {	// 저장후 소독결과 상세 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ051));
		
		if(!isNull(planSn)) {
			paramsArray.add(new BasicNameValuePair(Const.PLANSN, planSn));
		}	
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.RECNO, recNo));
		}
		
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getFirstPostQuarantineResult(String offCd) {	// 검역결과  최초 파라메터
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ006));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	public static ArrayList<NameValuePair> getPostQuarantineResult(HashMap<String, String> searchMap) {	// 검역결과  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ008));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("insPlace").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSPLACE, searchMap.get("insPlace").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		if(!isNull(searchMap.get("searchBlNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHBLNO, searchMap.get("searchBlNo").toString()));
		}
		
		if(!isNull(searchMap.get("searchHwaNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHHWANO, searchMap.get("searchHwaNo").toString()));
		}
		
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getQuarantineResultDetailParams(String offCd, String recNo) {	// 검역결과 상세 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ010));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, recNo));
		}		
		
		return paramsArray;
	}
	
	// 소독 명령서, 소독 동의서, 소독 계획서
	public static ArrayList<NameValuePair> getDisinfectionPopupParams(String offCd, String recNo, int state) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		if(state == 0){	// 소독 계획서
			paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ022));
		}else if(state == 1){	// 소독 동의서
			paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ023));
		}else {	// 소독 명령서
			paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ024));
		}
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, recNo));
		}	
		
		return paramsArray;
	}
	
	// 결제 상세
	public static ArrayList<NameValuePair> getQuarantineApproveDetailParams(String offCd, String recNo) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ012));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRESOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRESNO, recNo));
		}		
		
		return paramsArray;
	}
	
	// 검역현황조회 최초
	public static ArrayList<NameValuePair> getFirstPostQuarantineStatus(String offCd) {	// 검역결과  최초 파라메터
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ013));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	// 검역현황조회
	public static ArrayList<NameValuePair> getPostQuarantineStatus(HashMap<String, String> searchMap) {	// 검역결과  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ013));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("insPlace").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSPLACE, searchMap.get("insPlace").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		return paramsArray;
	}
	
	// 검역현황 상세
	public static ArrayList<NameValuePair> getQuarantineStatusDetailParams(String offCd, String recNo) {	
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ029));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, recNo));
		}		
		
		return paramsArray;
	}
	
	// 소독 결과현황 최초
	public static ArrayList<NameValuePair> getFirstPostDisinfectionStatus(String offCd) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ016));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSTTCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	// 소독 결과현황
	public static ArrayList<NameValuePair> getPostDisinfectionStatus(HashMap<String, String> searchMap) {	
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ016));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSTTCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		return paramsArray;
	}
	
	// 소독현황 상세
	public static ArrayList<NameValuePair> getDisinfectionStatusDetailParams(String dsnfResNo, String dsnfResOffcd) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ034));
		
		if(!isNull(dsnfResNo)) {
			paramsArray.add(new BasicNameValuePair(Const.DSNFRESNO, dsnfResNo));
		}
		
		if(!isNull(dsnfResOffcd)) {
			paramsArray.add(new BasicNameValuePair(Const.DSNFRESOFFCD, dsnfResOffcd));
		}
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getDisinfectionStatusSearchDetailParams(String recNo, String offCd) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ034));
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.RECNO, recNo));
		}
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.OFFCD, offCd));
		}
		return paramsArray;
	}
	
	// 결재관리  파라메터
	public static ArrayList<NameValuePair> getPostApproveList(HashMap<String, String> searchMap) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ030));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("status").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSTATUS, searchMap.get("status").toString()));
		}
		
		if(!isNull(searchMap.get("sanctn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSANCTN, searchMap.get("sanctn").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		if(!isNull(searchMap.get("searchBlNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHBLNO, searchMap.get("searchBlNo").toString()));
		}
		
		if(!isNull(searchMap.get("searchHwaNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHHWANO, searchMap.get("searchHwaNo").toString()));
		}
		
		return paramsArray;
	}
	
	// 품목결과 요청
	public static ArrayList<NameValuePair> getPostProdResult(HashMap<String, String> searchMap) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ019));
		
		if(!isNull(searchMap.get("code").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHCODE, searchMap.get("code").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		return paramsArray;
	}
	
	public static ArrayList<NameValuePair> getPostProdSearch(String codeNm) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ032));
		
		if(!isNull(codeNm)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHCODENM, codeNm));
		}
		
		return paramsArray;
		
	}
	
	
	/* 검역신청 수정 */
	public static ArrayList<NameValuePair> getQuarantineUpdate(String jObj) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ005));
		
		if(!isNull(jObj)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDATA, jObj));
		}
		
		return paramsArray;
		
	}
	
	/* 검역결과 수정 */
	public static ArrayList<NameValuePair> getQuarantineResultUpdate(String master, String detail) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ009));
		
		if(!isNull(master)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTMASTER, master));
		}
		
		if(!isNull(detail)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDETAIL, detail));
		}
		
		return paramsArray;
		
	}
	
	/* 소독결과 수정 */
	public static ArrayList<NameValuePair> getDisinfectionResultUpdate(String master, String detail) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ015));
		
		if(!isNull(master)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTMASTER, master));
		}
		
		if(!isNull(detail)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDETAIL, detail));
		}
		
		return paramsArray;
		
	}
	
	/* 결재 요청 */
	public static ArrayList<NameValuePair> getApproveResult(String resultData) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ035));
		
		if(!isNull(resultData)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDATA, resultData));
		}
		
		return paramsArray;
		
	}
	
	public static boolean isNull(String str){
		return (str == null || str.equals(""))?true:false;
	}
	
	//현장검역관
	public static ArrayList<NameValuePair> getFirstPlaceOfficerParam(String searchNm, String searchOffCd) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ011));
		
		if(!isNull(searchOffCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchOffCd));
		}
		
		if(!isNull(searchNm)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHNM, searchNm));
		}
		
		return paramsArray;
		
	}
	
	// 품목결과 상세
		public static ArrayList<NameValuePair> getPostProdDetail(HashMap<String, String> searchMap) {
			ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
			paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ020));
			
			if(!isNull(searchMap.get("resOffCd").toString())) {
				paramsArray.add(new BasicNameValuePair(Const.RESOFFCD, searchMap.get("resOffCd").toString()));
			}
			
			if(!isNull(searchMap.get("resNo").toString())) {
				paramsArray.add(new BasicNameValuePair(Const.RESNO, searchMap.get("resNo").toString()));
			}
			
			if(!isNull(searchMap.get("resSeq").toString())) {
				paramsArray.add(new BasicNameValuePair(Const.RESSEQ, searchMap.get("resSeq").toString()));
			}
			
			return paramsArray;
		}
		
	//기안예문
	public static ArrayList<NameValuePair> getFirstDraftExamParam(String searchBs) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ025));
		
		if(!isNull(searchBs)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHBODYSE, searchBs));
		}
		
		return paramsArray;
		
	}
	
	// 일괄검역결과 등록 상세
	public static ArrayList<NameValuePair> getQuarantineEnblocParams(String recNoList, String progrs) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ036));
		
		if(!isNull(recNoList)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNOLIST, recNoList));
		}
		
		if(!isNull(progrs)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTPROGRSST, progrs));
		}		
		
		return paramsArray;
	}
	
	/* 일괄검역결과 수정 */
	public static ArrayList<NameValuePair> getQuarantineEnblocUpdate(String master, String detail) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ037));
		
		if(!isNull(master)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTMASTER, master));
		}
		
		if(!isNull(detail)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDETAIL, detail));
		}
		
		return paramsArray;
		
	}
	
	//관련병해충정보
	public static ArrayList<NameValuePair> getFirstRelationDiseaseParam(String searchType, String searchNatCd, 
			String searchOffcd, String searchRecNo) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ027));
		
		if(!isNull(searchType)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHTYPE, searchType));
		}
		
		if(!isNull(searchNatCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHNATCD, searchNatCd));
		}
		
		if(!isNull(searchOffcd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchOffcd));
		}
		
		if(!isNull(searchRecNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchRecNo));
		}
		
		return paramsArray;
		
	}
	
	// 일괄 결제 상세
	public static ArrayList<NameValuePair> getQuarantineApproveEnblocParams(String offCd) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ039));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.FULLRESNO, offCd));
		}
		
		return paramsArray;
	}
	
	/* 일괄 결재 요청 */
	public static ArrayList<NameValuePair> getApproveResultEnbloc(String resultData) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ038));
		
		if(!isNull(resultData)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDATA, resultData));
		}
		
		return paramsArray;
		
	}
	
	//업체검색 요청
	/* 일괄 결재 요청 */
	public static ArrayList<NameValuePair> getCompanySearchParams(String cprNm) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ026));
		
		if(!isNull(cprNm)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHCPRNM, cprNm));
		}
		
		return paramsArray;
		
	}
	
	//수출검역대기 리스트 최초요청
	public static ArrayList<NameValuePair> getFirstPostExportList(String offCd) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ042));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	//수출검역대기 리스트 두번이상요청
	public static ArrayList<NameValuePair> getPostExportResult(HashMap<String, String> searchMap) {	// 검역결과  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ042));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("insPlace").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSPLACE, searchMap.get("insPlace").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		return paramsArray;
	}
	
	//수출검역대기 상세( 수출검역결과) 요청
	public static ArrayList<NameValuePair> getExportQuarantineResultDetailParams(String offCd, String recNo) {	// 검역결과 상세 파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ043));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		if(!isNull(recNo)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, recNo));
		}		
		
		return paramsArray;
	}
	
	//부기사항
	public static ArrayList<NameValuePair> getBuKipParams(String remCd) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ044));
		
		if(!isNull(remCd)) {
			paramsArray.add(new BasicNameValuePair(Const.REMCD, remCd));
		}
		
		return paramsArray;
	}
	
	//수출검역결과저장
	public static ArrayList<NameValuePair> getExportUpdateParams(String master, String detail) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ047));
		
		if(!isNull(master)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTMASTER, master));
		}
		
		if(!isNull(detail)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDETAIL, detail));
		}
		
		return paramsArray;
	}
	
	// 수출 검역현황조회 최초
	public static ArrayList<NameValuePair> getFirstExportPostQuarantineStatus(String offCd) {	// 검역결과  최초 파라메터
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ045));
		
		if(!isNull(offCd)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, offCd));
		}
		
		String sDate, eDate = "";
		
		sDate = BrUtilManager.getCurrentDateTime(0);
		eDate = BrUtilManager.getCurrentDateTime(0);
		
		if(!isNull(sDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, sDate));
		}
		
		if(!isNull(eDate)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, eDate));
		}
		
		return paramsArray;
		
	}
	
	// 수출 검역현황조회
	public static ArrayList<NameValuePair> getPostExportQuarantineStatus(HashMap<String, String> searchMap) {	// 검역결과  파라메터
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ045));
		
		if(!isNull(searchMap.get("offCd").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHOFFCD, searchMap.get("offCd").toString()));
		}
		
		if(!isNull(searchMap.get("recNo").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHRECNO, searchMap.get("recNo").toString()));
		}
		
		if(!isNull(searchMap.get("sDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHSDATE, searchMap.get("sDate").toString()));
		}
		
		if(!isNull(searchMap.get("eDate").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHEDATE, searchMap.get("eDate").toString()));
		}
		
		if(!isNull(searchMap.get("userSn").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHUSERSN, searchMap.get("userSn").toString()));
		}
		
		if(!isNull(searchMap.get("insPlace").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHINSPLACE, searchMap.get("insPlace").toString()));
		}
		
		if(!isNull(searchMap.get("venNm").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHVENNM, searchMap.get("venNm").toString()));
		}
		
		if(!isNull(searchMap.get("targetPage").toString())) {
			paramsArray.add(new BasicNameValuePair(Const.TARGETPAGE, searchMap.get("targetPage").toString()));
		}
		
		return paramsArray;
	}
	
	//수출단지선과장 등록조회
	public static ArrayList<NameValuePair> getFirstFruitPackingParam(String resOffCd, String resNo, String resSeq) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ048));
		
		if(!isNull(resOffCd)) {
			paramsArray.add(new BasicNameValuePair(Const.RESOFFCD, resOffCd));
		}
		
		if(!isNull(resNo)) {
			paramsArray.add(new BasicNameValuePair(Const.RESNO, resNo));
		}
		
		if(!isNull(resSeq)) {
			paramsArray.add(new BasicNameValuePair(Const.RESSEQ, resSeq));
		}
		
		return paramsArray;
		
	}
	
	//수출단지선과장 조회
	public static ArrayList<NameValuePair> getSearchFruitPackingParam(String searchAppoinYear, String searchKorNm) {
		
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ046));
		
		if(!isNull(searchAppoinYear)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHAPPOINTYEAR, searchAppoinYear));
		}
		
		if(!isNull(searchKorNm)) {
			paramsArray.add(new BasicNameValuePair(Const.SEARCHKORNM, searchKorNm));
		}
		
		return paramsArray;
		
	}
	
	//선과장저장
	public static ArrayList<NameValuePair> getFruitPackingUpdateParams(String resultData) {
		ArrayList<NameValuePair> paramsArray = new ArrayList<NameValuePair>();
		paramsArray.add(new BasicNameValuePair(Const.PARAM_TARGET, Const.REQ049));
		if(!isNull(resultData)) {
			paramsArray.add(new BasicNameValuePair(Const.RESULTDATA, resultData));
		}
		return paramsArray;
	}
}
